package crm.modefy2;
/**
 * help类，用来存放不同的help查看的内容输出
 * 以及解析 HELP 类的Command属于哪一类help指令
 * 并作出相应的输出
 * @author ZHUAN4
 *
 */
public class Help {
	
	public static void helpHandle(String[] infos){
		if(infos.length==1)
		{
			helpAll();
		}
		else{
			switch(infos[1]){
			case "" : helpAll();    		 break;
			case "L": help();helpList();     break;
			case "A": help(); helpAdd();     break;
			case "D": help(); helpDelete();  break;
			case "U": help(); helpUpdate();  break;
			case "O": help(); helpOrder();   break;
			case "Q": help(); helpQuit();    break;
			case "H": help(); helpHelp();    break;
			default :  helpAll();    		 break;
			}
		}
	}
	
	public static void helpAll(){
		help();
		helpList();
		helpAdd();
		helpDelete();
		helpUpdate();
		helpOrder();
		helpQuit();
		helpHelp();
	}

	/**
	 * 每次使用help的抬头输出信息
	 */
	public static void help(){
		System.out.println("Help Document");
		System.out.println("Customer Reationship Management!  version 1.0 ");
		System.out.println("designed by Anger Zhu  designed time 7/7/2017 ");
		System.out.println("Command  parameter                     	                       Remarks");
	}
	
	public static void helpList(){
		System.out.println("L 	[name][id]············································ "+"List all customer`s information or list only by name");
	}
	
	public static void helpAdd(){
		System.out.println("A 	name:xxx,sex:xxx,birthday:xxx,address:xxx,call:xxx···· "+"Add a cuntomer`s information input by this");
	}
	
	public static void helpDelete(){
		System.out.println("D	id···················································· "+"Delete some customer`s information by his ID");
	}
	
	public static void helpUpdate(){
		System.out.println("D 	ID name:xxx,sex:xxx,birthday:xxx,address:xxx,call:xxx· "+"Update some customer`s information by his ID");
	}
	
	public static void helpOrder(){
		System.out.println("O 	id/name··············································· "+"SORT customer`s information by his ID");
	}
	
	public static void helpQuit(){
		System.out.println("Q 	······················································ "+"Quit the Customer Reationship Management!");
	}
	
	private static void helpHelp() {
		// TODO Auto-generated method stub
		System.out.println("H	[L][A][D][U][O][H][Q]································· "+"Help fuction,choose the word to get you want specificly");
	}

}
